<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="${pageContext.request.contextPath}/static/js/jquery.js"></script>

    <script>
        $("document").ready(() => {
            $("")
        })
        let login = () => {
            $.post({
                url: "${pageContext.request.contextPath}/login",
                data: {
                    userName: $("input[name='user']").val(),
                    password: $("input[name='password']").val()
                },
                success: (res) => {
                    if(res === "true"){
                        alert("认证成功")
                    } else {
                        alert("认证失败")
                    }
                }
            })
        }
    </script>
</head>

<div>
    <div>
        <span>用户名: </span>
        <input type="text" name="user">
    </div>
    <div>
        <span>密码: </span>
        <input type="password" name="password">
    </div>
    <button onclick="login()">提交</button>
</div>


</body>
</html>
